var re = /JS*/ig;
var str = "cfdsJS *(&YJSjs 888JS";
var result = re.exec(str);
document.writeln("<p>"+str.replace(re,"HaHa")+"</p>");
while(result) {
	document.writeln("<p>"+result[0]+"</p>");
	result = re.exec(str);
}
